#include "frame.h"

MyFrame::MyFrame()
: wxFrame(NULL, -1, _T("My Frame"), wxPoint(-1,-1), wxSize(460,460)){
	wxColour c1, c2;
	c1.Set(_T("#4F5049"));
	c2.Set(_T("#EDEDED"));

	wxPanel *panel = new wxPanel(this, wxID_ANY, wxPoint(120,120), wxSize(222,222));
	panel->SetBackgroundColour(c1);

	wxPanel *midpanel = new wxPanel(this, wxID_ANY, wxPoint(20,30), wxSize(55,33));
	midpanel->SetBackgroundColour(c2);

	// wxBoxSizer对象
	wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
	wxBoxSizer *hbox0 = new wxBoxSizer(wxHORIZONTAL);
	wxBoxSizer *hbox1 = new wxBoxSizer(wxHORIZONTAL);

//	vbox->Add(midpanel, 1, wxEXPAND|wxALL, 20);
//	panel->SetSizer(vbox);

	// 右下角放置按钮
	wxButton *btn0 = new wxButton(panel, wxID_ANY, _T("按钮1"), wxDefaultPosition, wxSize(40,20));
	wxButton *btn1 = new wxButton(panel, wxID_ANY, _T("按钮2"));

	hbox0->Add(new wxPanel(panel, wxID_ANY));
	hbox1->Add(btn);

	vbox->Add(hbox0, 1, wxEXPAND);
	vbox->Add(hbox1, 0, wxALIGN_RIGHT|wxRIGHT|wxBOTTOM, 110);
	panel->SetSizer(vbox);

	Centre();
}
